Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[loterre-resolvers] Migrate from GitBucket #46

Merged
merged 45 commits into from
Oct 23, 2024

Conversation

parmentf
Copy link
Contributor

No description provided.

@parmentf parmentf added the enhancement New feature or request label Feb 13, 2024
@parmentf parmentf self-assigned this Feb 13, 2024
@parmentf
Copy link
Contributor Author

parmentf commented Feb 13, 2024

I forgot that this service get its data from a non-public website.
That makes test to fail, because no initialization succeeds.
Let's decide which way will be used:

  • dvc
  • simple webdav
  • static public server

@parmentf parmentf added migration Migrate from GitBucket and removed enhancement New feature or request labels May 31, 2024
@parmentf parmentf changed the title Migrate loterre-resolvers from GitBucket [loterre-resolvers] Migrate from GitBucket Aug 1, 2024
@parmentf
Copy link
Contributor Author

Decision: use DVC, and update the service each time a resource is updated.
Once migrated, desactivate GitLab CI which heat the cache...

@parmentf
Copy link
Contributor Author

parmentf commented Oct 9, 2024

D63's tests don't pass.

Here is the log:

WARNING: uri not found (D63), item #1 was ignored NotFoundError: No cache entry for "D63" found in /tmp/databases/41/D63/db/loterre-vocabulaires-loaded
    at Object.getData [as get] (/app/node_modules/@ezs/storage/node_modules/cacache/lib/get.js:25:11)
    at async Object.load (/app/node_modules/@ezs/storage/lib/load.js:38:19) {
  code: 'ENOENT',
  cache: '/tmp/databases/41/D63/db/loterre-vocabulaires-loaded',
  key: '"D63"'
}

<--- Last few GCs --->

[60:0x4ef6cb0]   227421 ms: Scavenge 1013.4 (1033.4) -> 1010.4 (1033.9) MB, 2.0 / 0.0 ms  (average mu = 0.174, current mu = 0.108) allocation failure 
[60:0x4ef6cb0]   227429 ms: Scavenge 1013.9 (1033.9) -> 1010.9 (1034.1) MB, 2.0 / 0.0 ms  (average mu = 0.174, current mu = 0.108) allocation failure 
[60:0x4ef6cb0]   227438 ms: Scavenge 1014.3 (1034.1) -> 1011.3 (1042.6) MB, 2.2 / 0.0 ms  (average mu = 0.174, current mu = 0.108) allocation failure 


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb090e0 node::Abort() [/root/.nvm/versions/node/v16.20.2/bin/node]
 2: 0xa1b70e  [/root/.nvm/versions/node/v16.20.2/bin/node]
 3: 0xce1a20 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/root/.nvm/versions/node/v16.20.2/bin/node]
 4: 0xce1dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/root/.nvm/versions/node/v16.20.2/bin/node]
 5: 0xe99435  [/root/.nvm/versions/node/v16.20.2/bin/node]
 6: 0xe99f16  [/root/.nvm/versions/node/v16.20.2/bin/node]
 7: 0xea843e  [/root/.nvm/versions/node/v16.20.2/bin/node]
 8: 0xea8e80 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/root/.nvm/versions/node/v16.20.2/bin/node]
 9: 0xeabd75 v8::internal::Heap::HandleGCRequest() [/root/.nvm/versions/node/v16.20.2/bin/node]
10: 0xe39417 v8::internal::StackGuard::HandleInterrupts() [/root/.nvm/versions/node/v16.20.2/bin/node]
11: 0x11e5ab4 v8::internal::Runtime_StackGuardWithGap(int, unsigned long*, v8::internal::Isolate*) [/root/.nvm/versions/node/v16.20.2/bin/node]
12: 0x15d9e59  [/root/.nvm/versions/node/v16.20.2/bin/node]

This StackOverflow says that node jave a default value of 512MB of memory.

One should try to increase the setting to more (1GB) using:

export NODE_OPTIONS="--max-old-space-size=1024"

@parmentf
Copy link
Contributor Author

parmentf commented Oct 9, 2024

Ooops. config.json already sets the option to 1GB.

"NODE_OPTIONS": "--max_old_space_size=1024",

Let's try 2GB, or more...

@parmentf
Copy link
Contributor Author

Github Action failed:

#28 [build  8/13] COPY --chown=daemon:daemon --from=dvcfiles /dvc/databases /tmp/databases
#28 DONE 694.1s

#29 [build  9/13] COPY --chown=daemon:daemon ./v1 /app/public/v1
#29 DONE 0.1s

#30 [build 10/13] COPY --chown=daemon:daemon ./swagger.json /app/public/
#30 DONE 0.0s

#31 [build 11/13] COPY --chown=daemon:daemon ./config.json /app
#31 DONE 0.0s

#32 [build 12/13] WORKDIR /app/public
#32 DONE 0.0s

#33 [build 13/13] RUN rm /app/public/parse.*
#33 DONE 0.4s

#34 exporting to image
#34 exporting layers
Killed
ERROR: failed to solve: Canceled: context canceled
Error: The operation was canceled.

I fear that the problem is caused by the number of files from stage 8 (databases), because StackOverflow says to add a .dockerignore file to solve the context canceled error. But our .dockerignore is already very restrictive.

find databases/ | wc -l
2067450

2 millions files is big, indeed.

A solution would be to untar the files at container's start, but that means to overwrite the docker-entrypoint.sh from the ezs-python-server base image:

#!/bin/sh

# Restore owner
find /app/public ! -user daemon -exec chown daemon:daemon {} \;
find /tmp ! -user daemon -exec chown daemon:daemon {} \;

cd /app
node generate-dotenv.js
cd /app/public

# Run ezs server as daemon user
su -s /bin/bash daemon -c "npx dotenv -e ../.env -- npx ezs --daemon ./"

@parmentf parmentf merged commit 1de6e16 into main Oct 23, 2024
1 check passed
@parmentf parmentf deleted the services/loterre-resolvers/migrate branch October 23, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migration Migrate from GitBucket
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant